Echo = $FFEF
Monitor = $FF1F

  LDY #$00          ;  Initialize counter to 0

caps:
  LDA string,Y      ;  Load in first character
  CMP #$00          ;  Is this character null?
  BEQ done          ;  If so, we're done converting
  CMP #$41          ;  Is this character not a letter?
  BMI skip          ;  If so, skip it
  AND #$DF          ;  Mask with $DF to convert to uppercase
  STA string,Y      ;  Overwrite original character with the new
skip:
  INY               ;  Increment the counter
  JMP caps          ;  Loop to the next character

done:
  LDA #<string      ;  Save memory address of string for access by PrintSub
  STA $00
  LDA #>string
  STA $01
  JSR printsub      ;  Print the new uppercase string
  
  JMP Monitor

string:
  .asc "lowercase string, MOSTLY",$00






/*
Name:               PrintSub
Precondtions:       Address of string to print is stored at $00,$01.
Postcondtions:      The string is printed to screen.
Destroys:           A, Y, Flags.
Description:        Prints the string at the address at $00,$01.
*/

printsub:
  LDY #$00          ;  Our loop expects X to start at 0
printchar:
  LDA ($00),Y       ;  Load the next character
  CMP #$00          ;  Compare char to NULL ($00)
  BEQ doneprintsub  ;  If NULL break out of loop
  JSR Echo          ;  If not NULL, print the character
  INY               ;  Increment X, so we can get at the next character
  JMP printchar     ;  Loop again 
doneprintsub:
  RTS
